%!TEX program = xelatex
\documentclass[t,12pt,aspectratio=169]{beamer} % 16:9 宽屏比例
\usepackage{ctex} % 中文支持
\usepackage{amsmath, amssymb, bm}
\usepackage{graphicx, color}
\usepackage{pythonhighlight}
\usepackage{hyperref}
\usepackage{booktabs}
\usepackage{multirow, multicol}

\usepackage{tikz} % 可选：用于绘图
\usetikzlibrary{shapes,arrows,arrows.meta}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 或者更彻底地使用 Latin Modern 数学字体（需 lualatex/xelatex）
\usepackage{unicode-math}
%\setmainfont{Latin Modern Roman}
\setmathfont{Latin Modern Math}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \usepackage{tikz} % 用于绘图
% \usetikzlibrary{shapes,arrows}
% \usetikzlibrary{circuits.ee.IEC} % 画电路
% \usetikzlibrary{arrows.meta, calc, positioning, quotes, angles, 3d}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 画函数图形
\usepackage{pgfplots} 
\pgfplotsset{compat=1.18} % 推荐设置兼容性版本

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{setspace}
\onehalfspacing
\setlength{\parskip}{1em}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addtobeamertemplate{frametitle}{}{\vspace*{0.5em}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usetheme{Madrid}
\usecolortheme{default}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{捕食者与被捕食者的微分方程}
\author{王立庆}
\institute{上海立信会计金融学院}
%\date{2025年9月26日}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

% 封面页
\begin{frame}
  \titlepage
\end{frame}

% 目录页
\begin{frame}{目录}
  \tableofcontents
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{捕食者与被捕食者的微分方程}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[allowframebreaks]{捕食者与被捕食者的微分方程}

{\color{red}问题：研究捕食者与被捕食者的生态问题，特别是两个种群的各自数量变换情况。} 

解答：建立模型，设捕食者总数为 $x(t)$, 被捕食者总数为 $y(t)$, 考虑微分方程组
$$
\left\{\begin{array}{rcl}
\frac{dx}{dt} &=& x(-\lambda + \sigma y), \\
\frac{dy}{dt} &=& y(\mu - \delta x). \\
\end{array}\right.
$$
其中 $\lambda, \sigma, \mu, \delta$ 为待定参数。

\newpage 

{\color{red}求解微分方程：}
两式相除，消去 $dt$, 可得 
%\begin{eqnarray*}
$\displaystyle \quad 
\frac{dy}{dx} = \frac{y(\mu - \delta x)}{x(-\lambda + \sigma y)}. 
$
%\end{eqnarray*}

分离变量法可得
%\begin{eqnarray*}
$\displaystyle \quad 
\frac{-\lambda + \sigma y}{y} dy= \frac{\mu - \delta x}{x} dx. 
$
%\end{eqnarray*}

两边积分可得通解 
$\displaystyle \quad 
-\lambda \ln y + \sigma y = \mu \ln x - \delta x + C, 
$

其中 $C$ 是任意常数。

\begin{figure}[ht]
\includegraphics [height=0.6\textheight, width=0.6\textwidth]{pic/fig-lokta.png}
\caption{食饵-捕者模型的一个解($\mu=1, \delta=0.1, \lambda=1.5, \sigma=0.075, C=2$)}
%\label{fig:lokta}
\end{figure}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{微分方程的参数估计}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[allowframebreaks]{微分方程的参数估计}

{\color{red}给定一段时间的捕食者和被捕食者的数据，估计微分方程中的参数的值。}

设捕食者与被捕食者的种群数量可由常微分方程组
\begin{eqnarray}
\left\{\begin{array}{l}
\frac{dx}{dt} = ax - bxy, \\
\frac{dy}{dt} = -cy + dxy,\\
\end{array}\right.
\label{eq-1}
\end{eqnarray}
描述，其中 $x(t)$ 表示第 $t$ 个月时被捕食者的数量，$y(t)$ 表示捕食者的数量。参数 $a,b,c,d$ 未知。

\begin{table}[ht]\centering
\caption{种群数量观测值}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}\hline
$t$     & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 8 & 10 & 12 & 14 & 16 & 18  \\ \hline
$x(t)$ & 60 & 63 & 64 & 63 & 61 & 58 & 53 & 44 & 39 & 38 & 41 & 46 & 53    \\  \hline
$y(t)$ & 30 & 34 & 38 & 44 & 50 & 55 & 58 & 56 & 47 & 38 & 30 & 27 & 26   \\  \hline
\end{tabular}
\end{table}

{\color{red}问题：\\ 
1. 利用表格中的观测数据，拟合未知参数。 \\
2. 画出这个模型的相图。
}

\newpage 

\begin{figure}[ht!]\centering
\includegraphics [height=0.6\textheight, width=0.6\textwidth]{pic/fig-lokta-scatter.png}
\caption{两个种群的数量按时间的变化}
\end{figure}

\newpage 

解答：首先画出散点图。

将微分方程写成差分方程，可得
\begin{eqnarray}
\left\{\begin{array}{l}
(x_{k+1}-x_k)/(t_{k+1}-t_k) = ax_k - bx_ky_k, \\ 
(y_{k+1}-y_k)/(t_{k+1}-t_k) = -cy_k + dx_ky_k, 
\end{array}\right. \,\, k=0,1,2,\cdots,11,
\label{eq-2}
\end{eqnarray}
其中 $x_k$ 和 $y_k$ 是 $x(t)$ 和 $y(t)$ 在 $t=t_k$ 时的观测值。
%
因为系数 $a,b,c,d$ 是未知的，所以将(\ref{eq-2})写成矩阵形式，可得
\begin{eqnarray}
\begin{bmatrix} x_k & -x_ky_k & 0 & 0 \\ 0 & 0 & -y_k & x_ky_k \end{bmatrix} 
\begin{bmatrix} a \\ b \\ c \\ d  \end{bmatrix} 
=\begin{bmatrix} (x_{k+1}-x_k)/(t_{k+1}-t_k) \\ (y_{k+1}-y_k)/(t_{k+1}-t_k) \end{bmatrix}. 
\label{eq-3}
\end{eqnarray}

将12组观测值放在一起，可得超定的线性方程组，然后使用最小二乘法求解，
\begin{eqnarray}
\begin{bmatrix} 
x_0 & -x_0y_0 & 0 & 0 \\ 
x_1 & -x_1y_1 & 0 & 0 \\ 
\vdots & \vdots & \vdots & \vdots \\ 
x_{11} & -x_{11}y_{11} & 0 & 0 \\ 
0 & 0 & -y_0 & x_0y_0 \\ 
0 & 0 & -y_1 & x_1y_1 \\ 
\vdots & \vdots & \vdots & \vdots \\ 
0 & 0 & -y_{11} & x_{11}y_{!1} \\ 
\end{bmatrix} 
\begin{bmatrix} a \\ b \\ c \\ d  \end{bmatrix} 
=\begin{bmatrix} 
(x_{1}-x_0)/(t_{1}-t_0) \\ 
(x_{2}-x_1)/(t_{2}-t_1) \\ 
\vdots  \\ 
(x_{12}-x_{11})/(t_{12}-t_{11}) \\ 
(y_{1}-y_0)/(t_{1}-t_0) \\ 
(y_{2}-y_1)/(t_{2}-t_1) \\ 
\vdots  \\ 
(y_{12}-y_{11})/(t_{12}-t_{11}) \\ 
\end{bmatrix}. 
\label{eq-4}
\end{eqnarray}

回答问题：

编程计算，可得参数a,b,c,d的值分别为
$$
[a,b,c,d] = [0.1907, 0.0048, 0.4829, 0.0095]. 
$$

\newpage 

\begin{figure}[ht!]\centering
\includegraphics [height=0.6\textheight, width=0.6\textwidth]{pic/fig-lokta-quiver.png}
\caption{常微分方程组的方向场与相图}
\end{figure}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{模型检验}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[allowframebreaks]{模型检验}

{\color{red}问题：衡量该微分方程模型能否准确地反映这些数据。}




\end{frame}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{模型应用}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[allowframebreaks]{模型应用}

设捕食者与被捕食者的总体数量由常微分方程组
\begin{eqnarray}
\left\{\begin{array}{rcl}
\frac{dx}{dt} &=& 0.2x - 0.005xy, \\
\frac{dy}{dt} &=& -0.5y + 0.01xy,\\
\end{array}\right.
\end{eqnarray}
描述，其中 $x(t)$ 表示第 $t$ 个月时被捕食者的数量，$y(t)$ 表示捕食者的数量。
设初始时刻的数量分别为 
\begin{eqnarray}
\left\{\begin{array}{rcl}
x(0) &=& 70, \\ 
y(0) &=& 40. 
\end{array}\right.
\end{eqnarray}

{\color{red}问题：\\ 
1. 求被捕食者的总体数量 $x(t)$ 和捕食者的总体数量 $y(t)$ 的变化的周期。\\ 
2. 求被捕食者的总体数量 $x(t)$ 的最大值和最小值。\\
3. 求捕食者的总体数量 $y(t)$ 的最大值和最小值。
}

计算思路：

首先考虑这个常微分方程组的平衡点。设 $dx/dt=0$ 以及 $dy/dt=0$, 可得
\begin{eqnarray}
\left\{\begin{array}{rcl}
 0.2x - 0.005xy &=& 0, \\
 -0.5y + 0.01xy &=& 0. 
\end{array}\right.
\end{eqnarray}
由此求得平衡点为 $(x,y)=(0,0)$ 与 $(x,y)=(50,40)$. 

我们的主要方法是使用 pylab 模块的 quiver 函数画出这个常微分方程组的方向场，和使用 scipy.integrate 模块的 odeint 函数求出这个常微分方程组的数值解。

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

回答问题：

两个稳定点为 $(0, 0)$ 和 $(50, 40)$. 
x的最大值为70, 最小值为34. 
y的最大值为 67, y的最小值为21. 
两个种群的总体数量的变化周期约为20个月。

\newpage 

\begin{figure}[ht!]\centering
\includegraphics [height=0.6\textheight, width=0.6\textwidth]{pic/fig-lokta-period.png}
\caption{被捕食者（红线）与捕食者（蓝线）的数量与时间的函数图}
 \end{figure}
 
 
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{参考文献}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{参考文献}

\begin{thebibliography}{99}

\bibitem{dingtongren} 丁同仁, 李承治. 常微分方程教程. 高等教育出版社, 2022.

\bibitem{sishoukui-2} 司守奎, 孙玺菁. Python数学建模算法与应用. 国防工业出版社, 2022. 

\bibitem{scipy} Scipy Cookbook. Lokta Volterra Tutorial. 
\url{https://scipy-cookbook.readthedocs.io/items/LoktaVolterraTutorial.html}

\end{thebibliography}

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{附录代码}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{附录代码}

lokta.py \\
lokta-scatter.py \\
lokta-parameter.py \\
lokta-period.py 

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{进一步研究方向}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[allowframebreaks]{进一步研究方向}

已研究问题：

\begin{enumerate}\itemsep0em 
\item 模型推导：从生态假设出发建立微分方程。
\item 求解方程：解析或数值求解。
\item 参数估计：根据观测数据拟合参数。
\item 相图分析：绘制相轨迹、平衡点、极限环。
\item 周期规律：是否存在周期解？周期多长？
\item 最大值与最小值：种群数量的波动范围。
\end{enumerate}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage 

拓展研究方向：
\begin{multicols}{2}
\begin{enumerate}\itemsep0em 
\item 平衡点的稳定性分析
\item 极限环的存在性与唯一性
\item 分岔分析
\item 功能响应的影响
\item 环境承载力与密度依赖
\item 扩散与空间结构
\item 随机性与噪声影响
\item 最优控制与管理策略
\item 多个物种的扩展
\item 时滞效应
\item 灭绝与共存条件
\item 混沌行为
\item 尺度分析与无量纲化
\item 数值模拟与长期行为
\item 模型验证与不确定性分析
\end{enumerate}
\end{multicols}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage 

\begin{table}[ht]\centering
\caption{捕食者-被捕食者模型的完整研究框架}
\begin{tabular}{|c|c|} \hline 
研究方向 & 具体问题 \\ \hline \hline 
建模 & 功能响应、承载力、时滞、空间扩散  \\ \hline 
分析 & 平衡点、稳定性、极限环、分岔  \\ \hline 
求解 & 解析解（稀有）、数值解、渐近解  \\ \hline 
参数 & 估计、敏感性、不确定性  \\ \hline 
动力学 & 周期、混沌、吸引子、初值敏感性  \\ \hline 
应用 & 资源管理、灭绝预警、保护策略  \\ \hline 
扩展 & 多物种、随机性、网络结构、最优控制  \\ \hline 
\end{tabular}
\end{table}

一句话总结：
从一个简单的微分方程出发，我们可以走向生态学、动力系统、控制论、统计推断和复杂科学的广阔世界。

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}
